home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / System 7 / Frontier / Frontier SDK 2.1.sit / Frontier SDK 2.1 / Toolkits / IAC Tools / iacapps.c < prev    next >
MacBinary  |  1993-05-20  |  5.3 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Thu May 20 00:45:03 1993, modified Thu May 20 00:45:03 1993, creator Think C, type ASCII, 4642 bytes "iacapps.c" , at 0x12a2 402 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 69 61 63 61 70 70 | 73 2e 63 00 00 00 00 00 |..iacapp|s.c.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 12 22 00 | 00 01 92 a8 20 bd 4f a8 |......".|.... .O.|
|00000060| 20 bd 4f 00 00 00 00 00 | 00 00 00 00 00 00 00 00 | .O.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 51 58 00 00 |........|....QX..|
|00000080| 0d 2f 2a a9 20 43 6f 70 | 79 72 69 67 68 74 20 31 |./*. Cop|yright 1|
|00000090| 39 38 38 2d 31 39 39 32 | 20 55 73 65 72 4c 61 6e |988-1992| UserLan|
|000000a0| 64 20 53 6f 66 74 77 61 | 72 65 2c 20 49 6e 63 2e |d Softwa|re, Inc.|
|000000b0| 20 20 41 6c 6c 20 52 69 | 67 68 74 73 20 52 65 73 | All Ri|ghts Res|
|000000c0| 65 72 76 65 64 2e 2a 2f | 0d 0d 23 69 6e 63 6c 75 |erved.*/|..#inclu|
|000000d0| 64 65 20 22 69 61 63 69 | 6e 74 65 72 6e 61 6c 2e |de "iaci|nternal.|
|000000e0| 68 22 0d 0d 0d 2f 2a 0d | 38 2f 32 34 2f 39 32 20 |h".../*.|8/24/92 |
|000000f0| 44 57 3a 20 54 68 65 20 | 72 6f 75 74 69 6e 65 73 |DW: The |routines|
|00000100| 20 69 6e 20 74 68 69 73 | 20 66 69 6c 65 20 61 72 | in this| file ar|
|00000110| 65 20 75 73 75 61 6c 6c | 79 20 6f 6e 6c 79 20 6e |e usuall|y only n|
|00000120| 65 65 64 65 64 20 69 6e | 20 64 6f 75 62 6c 65 2d |eeded in| double-|
|00000130| 0d 63 6c 69 63 6b 61 62 | 6c 65 20 61 70 70 6c 69 |.clickab|le appli|
|00000140| 63 61 74 69 6f 6e 73 2e | 0d 2a 2f 0d 0d 0d 4f 53 |cations.|.*/...OS|
|00000150| 45 72 72 20 49 41 43 64 | 72 69 76 65 66 69 6c 65 |Err IACd|rivefile|
|00000160| 6c 69 73 74 20 28 74 79 | 46 53 63 61 6c 6c 62 61 |list (ty|FScallba|
|00000170| 63 6b 20 68 61 6e 64 6c | 65 73 70 65 63 72 6f 75 |ck handl|especrou|
|00000180| 74 69 6e 65 29 20 7b 0d | 09 0d 09 2f 2a 0d 09 74 |tine) {.|.../*..t|
|00000190| 68 65 20 6f 70 65 6e 64 | 6f 63 20 61 6e 64 20 70 |he opend|oc and p|
|000001a0| 72 69 6e 74 64 6f 63 20 | 72 65 71 75 69 72 65 64 |rintdoc |required|
|000001b0| 20 65 76 65 6e 74 73 20 | 74 61 6b 65 20 61 20 6c | events |take a l|
|000001c0| 69 73 74 20 6f 66 20 66 | 69 6c 65 73 70 65 63 73 |ist of f|ilespecs|
|000001d0| 20 61 73 20 61 20 0d 09 | 70 61 72 61 6d 65 74 65 | as a ..|paramete|
|000001e0| 72 2e 20 77 65 20 66 61 | 63 74 6f 72 20 6f 75 74 |r. we fa|ctor out|
|000001f0| 20 74 68 65 20 63 6f 6d | 6d 6f 6e 20 63 6f 64 65 | the com|mon code|
|00000200| 2c 20 61 6e 64 20 6d 61 | 6b 65 20 69 74 20 61 20 |, and ma|ke it a |
|00000210| 6c 69 74 74 6c 65 20 65 | 61 73 69 65 72 20 66 6f |little e|asier fo|
|00000220| 72 20 61 6e 0d 09 61 70 | 70 6c 69 63 61 74 69 6f |r an..ap|plicatio|
|00000230| 6e 20 74 6f 20 68 61 6e | 64 6c 65 20 74 68 65 73 |n to han|dle thes|
|00000240| 65 20 65 76 65 6e 74 73 | 2e 0d 09 0d 09 79 6f 75 |e events|.....you|
|00000250| 20 73 75 70 70 6c 79 20 | 61 20 63 61 6c 6c 62 61 | supply |a callba|
|00000260| 63 6b 20 72 6f 75 74 69 | 6e 65 20 74 68 61 74 20 |ck routi|ne that |
|00000270| 68 61 6e 64 6c 65 73 20 | 61 20 73 69 6e 67 6c 65 |handles |a single|
|00000280| 20 66 69 6c 65 73 70 65 | 63 2c 20 79 6f 75 20 63 | filespe|c, you c|
|00000290| 6f 75 6c 64 0d 09 70 72 | 69 6e 74 20 69 74 20 6f |ould..pr|int it o|
|000002a0| 72 20 6f 70 65 6e 20 69 | 74 2c 20 64 65 70 65 6e |r open i|t, depen|
|000002b0| 64 69 6e 67 20 6f 6e 20 | 77 68 69 63 68 20 6f 66 |ding on |which of|
|000002c0| 20 74 68 65 20 72 65 71 | 75 69 72 65 64 20 65 76 | the req|uired ev|
|000002d0| 65 6e 74 73 20 69 73 20 | 62 65 69 6e 67 0d 09 69 |ents is |being..i|
|000002e0| 6e 76 6f 6b 65 64 2e 0d | 09 2a 2f 0d 0d 09 41 45 |nvoked..|.*/...AE|
|000002f0| 44 65 73 63 20 64 65 73 | 63 3b 0d 09 6c 6f 6e 67 |Desc des|c;..long|
|00000300| 20 63 74 66 69 6c 65 73 | 3b 0d 09 44 65 73 63 54 | ctfiles|;..DescT|
|00000310| 79 70 65 20 61 63 74 75 | 61 6c 74 79 70 65 3b 0d |ype actu|altype;.|
|00000320| 09 6c 6f 6e 67 20 61 63 | 74 75 61 6c 73 69 7a 65 |.long ac|tualsize|
|00000330| 3b 0d 09 41 45 4b 65 79 | 77 6f 72 64 20 61 63 74 |;..AEKey|word act|
|00000340| 75 61 6c 6b 65 79 77 6f | 72 64 3b 0d 09 46 53 53 |ualkeywo|rd;..FSS|
|00000350| 70 65 63 20 66 73 3b 0d | 09 6c 6f 6e 67 20 69 3b |pec fs;.|.long i;|
|00000360| 0d 09 4f 53 45 72 72 20 | 65 63 3b 0d 09 09 09 09 |..OSErr |ec;.....|
|00000370| 09 09 0d 09 65 63 20 3d | 20 41 45 47 65 74 4b 65 |....ec =| AEGetKe|
|00000380| 79 44 65 73 63 20 28 49 | 41 43 67 6c 6f 62 61 6c |yDesc (I|ACglobal|
|00000390| 73 2e 65 76 65 6e 74 2c | 20 6b 65 79 44 69 72 65 |s.event,| keyDire|
|000003a0| 63 74 4f 62 6a 65 63 74 | 2c 20 74 79 70 65 41 45 |ctObject|, typeAE|
|000003b0| 4c 69 73 74 2c 20 26 64 | 65 73 63 29 3b 0d 09 0d |List, &d|esc);...|
|000003c0| 09 49 41 43 67 6c 6f 62 | 61 6c 73 2e 65 72 72 6f |.IACglob|als.erro|
|000003d0| 72 63 6f 64 65 20 3d 20 | 65 63 3b 0d 09 0d 09 69 |rcode = |ec;....i|
|000003e0| 66 20 28 65 63 20 21 3d | 20 6e 6f 45 72 72 29 20 |f (ec !=| noErr) |
|000003f0| 0d 09 09 72 65 74 75 72 | 6e 20 28 65 63 29 3b 0d |...retur|n (ec);.|
|00000400| 09 09 0d 09 65 63 20 3d | 20 41 45 43 6f 75 6e 74 |....ec =| AECount|
|00000410| 49 74 65 6d 73 20 28 26 | 64 65 73 63 2c 20 26 63 |Items (&|desc, &c|
|00000420| 74 66 69 6c 65 73 29 3b | 0d 09 0d 09 49 41 43 67 |tfiles);|....IACg|
|00000430| 6c 6f 62 61 6c 73 2e 65 | 72 72 6f 72 63 6f 64 65 |lobals.e|rrorcode|
|00000440| 20 3d 20 65 63 3b 0d 09 | 0d 09 69 66 20 28 65 63 | = ec;..|..if (ec|
|00000450| 20 21 3d 20 6e 6f 45 72 | 72 29 20 0d 09 09 72 65 | != noEr|r) ...re|
|00000460| 74 75 72 6e 20 28 65 63 | 29 3b 0d 09 09 09 09 0d |turn (ec|);......|
|00000470| 09 66 6f 72 20 28 69 20 | 3d 20 31 3b 20 69 20 3c |.for (i |= 1; i <|
|00000480| 3d 20 63 74 66 69 6c 65 | 73 3b 20 69 20 2b 2b 29 |= ctfile|s; i ++)|
|00000490| 20 7b 0d 09 0d 09 09 65 | 63 20 3d 20 41 45 47 65 | {.....e|c = AEGe|
|000004a0| 74 4e 74 68 50 74 72 20 | 28 0d 09 09 09 26 64 65 |tNthPtr |(....&de|
|000004b0| 73 63 2c 20 69 2c 20 74 | 79 70 65 46 53 53 2c 20 |sc, i, t|ypeFSS, |
|000004c0| 26 61 63 74 75 61 6c 6b | 65 79 77 6f 72 64 2c 20 |&actualk|eyword, |
|000004d0| 26 61 63 74 75 61 6c 74 | 79 70 65 2c 20 0d 09 09 |&actualt|ype, ...|
|000004e0| 09 0d 09 09 09 28 50 74 | 72 29 20 26 66 73 2c 20 |.....(Pt|r) &fs, |
|000004f0| 73 69 7a 65 6f 66 20 28 | 66 73 29 2c 20 26 61 63 |sizeof (|fs), &ac|
|00000500| 74 75 61 6c 73 69 7a 65 | 29 3b 0d 09 09 09 09 09 |tualsize|);......|
|00000510| 09 09 0d 09 09 49 41 43 | 67 6c 6f 62 61 6c 73 2e |.....IAC|globals.|
|00000520| 65 72 72 6f 72 63 6f 64 | 65 20 3d 20 65 63 3b 0d |errorcod|e = ec;.|
|00000530| 09 0d 09 09 69 66 20 28 | 65 63 20 21 3d 20 6e 6f |....if (|ec != no|
|00000540| 45 72 72 29 20 7b 0d 09 | 09 0d 09 09 09 41 45 44 |Err) {..|.....AED|
|00000550| 69 73 70 6f 73 65 44 65 | 73 63 20 28 26 64 65 73 |isposeDe|sc (&des|
|00000560| 63 29 3b 0d 09 09 09 0d | 09 09 09 72 65 74 75 72 |c);.....|...retur|
|00000570| 6e 20 28 65 63 29 3b 0d | 09 09 09 7d 0d 09 09 09 |n (ec);.|...}....|
|00000580| 0d 09 09 69 66 20 28 21 | 28 2a 68 61 6e 64 6c 65 |...if (!|(*handle|
|00000590| 73 70 65 63 72 6f 75 74 | 69 6e 65 29 20 28 26 66 |specrout|ine) (&f|
|000005a0| 73 29 29 0d 09 09 09 72 | 65 74 75 72 6e 20 28 2d |s))....r|eturn (-|
|000005b0| 31 29 3b 0d 09 09 7d 20 | 2f 2a 66 6f 72 2a 2f 0d |1);...} |/*for*/.|
|000005c0| 09 09 0d 09 72 65 74 75 | 72 6e 20 28 6e 6f 45 72 |....retu|rn (noEr|
|000005d0| 72 29 3b 0d 09 7d 20 2f | 2a 49 41 43 64 72 69 76 |r);..} /|*IACdriv|
|000005e0| 65 66 69 6c 65 6c 69 73 | 74 2a 2f 0d 0d 0d 73 74 |efilelis|t*/...st|
|000005f0| 61 74 69 63 20 4f 53 54 | 79 70 65 20 49 41 43 67 |atic OST|ype IACg|
|00000600| 65 74 70 72 6f 63 65 73 | 73 63 72 65 61 74 6f 72 |etproces|screator|
|00000610| 20 28 76 6f 69 64 29 20 | 7b 0d 09 0d 09 2f 2a 0d | (void) |{..../*.|
|00000620| 09 67 65 74 20 74 68 65 | 20 34 2d 63 68 61 72 61 |.get the| 4-chara|
|00000630| 63 74 65 72 20 63 72 65 | 61 74 6f 72 20 69 64 65 |cter cre|ator ide|
|00000640| 6e 74 69 66 69 65 72 20 | 66 6f 72 20 74 68 65 20 |ntifier |for the |
|00000650| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 77 65 27 72 |applicat|ion we'r|
|00000660| 65 20 72 75 6e 6e 69 6e | 67 20 0d 09 69 6e 73 69 |e runnin|g ..insi|
|00000670| 64 65 20 6f 66 2e 0d 09 | 2a 2f 0d 09 0d 09 50 72 |de of...|*/....Pr|
|00000680| 6f 63 65 73 73 53 65 72 | 69 61 6c 4e 75 6d 62 65 |ocessSer|ialNumbe|
|00000690| 72 20 70 73 6e 3b 0d 09 | 50 72 6f 63 65 73 73 49 |r psn;..|ProcessI|
|000006a0| 6e 66 6f 52 65 63 20 69 | 6e 66 6f 3b 0d 09 0d 09 |nfoRec i|nfo;....|
|000006b0| 47 65 74 43 75 72 72 65 | 6e 74 50 72 6f 63 65 73 |GetCurre|ntProces|
|000006c0| 73 20 28 26 70 73 6e 29 | 3b 0d 09 0d 09 69 6e 66 |s (&psn)|;....inf|
|000006d0| 6f 2e 70 72 6f 63 65 73 | 73 49 6e 66 6f 4c 65 6e |o.proces|sInfoLen|
|000006e0| 67 74 68 20 3d 20 28 6c | 6f 6e 67 29 20 73 69 7a |gth = (l|ong) siz|
|000006f0| 65 6f 66 20 28 69 6e 66 | 6f 29 3b 0d 09 0d 09 69 |eof (inf|o);....i|
|00000700| 6e 66 6f 2e 70 72 6f 63 | 65 73 73 4e 61 6d 65 20 |nfo.proc|essName |
|00000710| 3d 20 6e 69 6c 3b 0d 09 | 0d 09 69 6e 66 6f 2e 70 |= nil;..|..info.p|
|00000720| 72 6f 63 65 73 73 41 70 | 70 53 70 65 63 20 3d 20 |rocessAp|pSpec = |
|00000730| 6e 69 6c 3b 0d 09 0d 09 | 47 65 74 50 72 6f 63 65 |nil;....|GetProce|
|00000740| 73 73 49 6e 66 6f 72 6d | 61 74 69 6f 6e 20 28 26 |ssInform|ation (&|
|00000750| 70 73 6e 2c 20 26 69 6e | 66 6f 29 3b 0d 09 0d 09 |psn, &in|fo);....|
|00000760| 72 65 74 75 72 6e 20 28 | 69 6e 66 6f 2e 70 72 6f |return (|info.pro|
|00000770| 63 65 73 73 53 69 67 6e | 61 74 75 72 65 29 3b 0d |cessSign|ature);.|
|00000780| 09 7d 20 2f 2a 49 41 43 | 67 65 74 70 72 6f 63 65 |.} /*IAC|getproce|
|00000790| 73 73 63 72 65 61 74 6f | 72 2a 2f 0d 09 0d 09 0d |sscreato|r*/.....|
|000007a0| 73 74 61 74 69 63 20 70 | 61 73 63 61 6c 20 4f 53 |static p|ascal OS|
|000007b0| 45 72 72 20 43 6f 65 72 | 63 65 54 61 72 67 65 74 |Err Coer|ceTarget|
|000007c0| 49 44 54 6f 54 79 70 65 | 20 28 44 65 73 63 54 79 |IDToType| (DescTy|
|000007d0| 70 65 20 74 79 70 65 63 | 6f 64 65 2c 20 50 74 72 |pe typec|ode, Ptr|
|000007e0| 20 64 61 74 61 70 74 72 | 2c 20 53 69 7a 65 20 64 | dataptr|, Size d|
|000007f0| 61 74 61 73 69 7a 65 2c | 20 44 65 73 63 54 79 70 |atasize,| DescTyp|
|00000800| 65 20 74 6f 74 79 70 65 | 2c 20 6c 6f 6e 67 20 72 |e totype|, long r|
|00000810| 65 66 63 6f 6e 2c 20 41 | 45 44 65 73 63 20 2a 72 |efcon, A|EDesc *r|
|00000820| 65 73 75 6c 74 29 20 7b | 0d 09 0d 09 54 61 72 67 |esult) {|....Targ|
|00000830| 65 74 49 44 20 74 61 72 | 67 65 74 3b 0d 09 50 72 |etID tar|get;..Pr|
|00000840| 6f 63 65 73 73 53 65 72 | 69 61 6c 4e 75 6d 62 65 |ocessSer|ialNumbe|
|00000850| 72 20 70 73 6e 3b 0d 09 | 50 72 6f 63 65 73 73 49 |r psn;..|ProcessI|
|00000860| 6e 66 6f 52 65 63 20 69 | 6e 66 6f 3b 0d 09 50 74 |nfoRec i|nfo;..Pt|
|00000870| 72 20 61 64 64 72 65 73 | 73 6f 66 74 79 70 65 3b |r addres|softype;|
|00000880| 0d 09 4f 53 45 72 72 20 | 65 63 3b 0d 09 0d 09 42 |..OSErr |ec;....B|
|00000890| 6c 6f 63 6b 4d 6f 76 65 | 20 28 64 61 74 61 70 74 |lockMove| (datapt|
|000008a0| 72 2c 20 26 74 61 72 67 | 65 74 2c 20 73 69 7a 65 |r, &targ|et, size|
|000008b0| 6f 66 20 28 74 61 72 67 | 65 74 29 29 3b 0d 09 0d |of (targ|et));...|
|000008c0| 09 69 66 20 28 74 61 72 | 67 65 74 2e 6c 6f 63 61 |.if (tar|get.loca|
|000008d0| 74 69 6f 6e 2e 6c 6f 63 | 61 74 69 6f 6e 4b 69 6e |tion.loc|ationKin|
|000008e0| 64 53 65 6c 65 63 74 6f | 72 20 3d 3d 20 70 70 63 |dSelecto|r == ppc|
|000008f0| 4e 6f 4c 6f 63 61 74 69 | 6f 6e 29 20 7b 20 2f 2a |NoLocati|on) { /*|
|00000900| 6c 6f 63 61 6c 20 70 72 | 6f 67 72 61 6d 2a 2f 0d |local pr|ogram*/.|
|00000910| 09 09 0d 09 09 65 63 20 | 3d 20 47 65 74 50 72 6f |.....ec |= GetPro|
|00000920| 63 65 73 73 53 65 72 69 | 61 6c 4e 75 6d 62 65 72 |cessSeri|alNumber|
|00000930| 46 72 6f 6d 50 6f 72 74 | 4e 61 6d 65 20 28 26 74 |FromPort|Name (&t|
|00000940| 61 72 67 65 74 2e 6e 61 | 6d 65 2c 20 26 70 73 6e |arget.na|me, &psn|
|00000950| 29 3b 0d 09 09 0d 09 09 | 69 66 20 28 65 63 20 21 |);......|if (ec !|
|00000960| 3d 20 6e 6f 45 72 72 29 | 0d 09 09 09 72 65 74 75 |= noErr)|....retu|
|00000970| 72 6e 20 28 65 63 29 3b | 0d 09 09 0d 09 09 69 6e |rn (ec);|......in|
|00000980| 66 6f 2e 70 72 6f 63 65 | 73 73 49 6e 66 6f 4c 65 |fo.proce|ssInfoLe|
|00000990| 6e 67 74 68 20 3d 20 28 | 6c 6f 6e 67 29 20 73 69 |ngth = (|long) si|
|000009a0| 7a 65 6f 66 20 28 69 6e | 66 6f 29 3b 0d 09 09 0d |zeof (in|fo);....|
|000009b0| 09 09 69 6e 66 6f 2e 70 | 72 6f 63 65 73 73 4e 61 |..info.p|rocessNa|
|000009c0| 6d 65 20 3d 20 6e 69 6c | 3b 0d 09 09 0d 09 09 69 |me = nil|;......i|
|000009d0| 6e 66 6f 2e 70 72 6f 63 | 65 73 73 41 70 70 53 70 |nfo.proc|essAppSp|
|000009e0| 65 63 20 3d 20 6e 69 6c | 3b 0d 09 09 0d 09 09 65 |ec = nil|;......e|
|000009f0| 63 20 3d 20 47 65 74 50 | 72 6f 63 65 73 73 49 6e |c = GetP|rocessIn|
|00000a00| 66 6f 72 6d 61 74 69 6f | 6e 20 28 26 70 73 6e 2c |formatio|n (&psn,|
|00000a10| 20 26 69 6e 66 6f 29 3b | 0d 09 09 0d 09 09 69 66 | &info);|......if|
|00000a20| 20 28 65 63 20 21 3d 20 | 6e 6f 45 72 72 29 0d 09 | (ec != |noErr)..|
|00000a30| 09 09 72 65 74 75 72 6e | 20 28 65 63 29 3b 0d 09 |..return| (ec);..|
|00000a40| 09 09 0d 09 09 61 64 64 | 72 65 73 73 6f 66 74 79 |.....add|ressofty|
|00000a50| 70 65 20 3d 20 28 50 74 | 72 29 20 26 69 6e 66 6f |pe = (Pt|r) &info|
|00000a60| 2e 70 72 6f 63 65 73 73 | 53 69 67 6e 61 74 75 72 |.process|Signatur|
|00000a70| 65 3b 0d 09 09 7d 0d 09 | 09 0d 09 65 6c 73 65 20 |e;...}..|...else |
|00000a80| 7b 20 2f 2a 6e 6f 74 20 | 61 20 6c 6f 63 61 6c 20 |{ /*not |a local |
|00000a90| 70 72 6f 67 72 61 6d 2a | 2f 0d 09 09 0d 09 09 69 |program*|/......i|
|00000aa0| 66 20 28 74 61 72 67 65 | 74 2e 6e 61 6d 65 2e 70 |f (targe|t.name.p|
|00000ab0| 6f 72 74 4b 69 6e 64 53 | 65 6c 65 63 74 6f 72 20 |ortKindS|elector |
|00000ac0| 3d 3d 20 70 70 63 42 79 | 43 72 65 61 74 6f 72 41 |== ppcBy|CreatorA|
|00000ad0| 6e 64 54 79 70 65 29 0d | 09 09 09 61 64 64 72 65 |ndType).|...addre|
|00000ae0| 73 73 6f 66 74 79 70 65 | 20 3d 20 28 50 74 72 29 |ssoftype| = (Ptr)|
|00000af0| 20 26 74 61 72 67 65 74 | 2e 6e 61 6d 65 2e 75 2e | &target|.name.u.|
|00000b00| 70 6f 72 74 2e 63 72 65 | 61 74 6f 72 3b 0d 09 09 |port.cre|ator;...|
|00000b10| 65 6c 73 65 0d 09 09 09 | 61 64 64 72 65 73 73 6f |else....|addresso|
|00000b20| 66 74 79 70 65 20 3d 20 | 28 28 50 74 72 29 20 26 |ftype = |((Ptr) &|
|00000b30| 74 61 72 67 65 74 2e 6e | 61 6d 65 2e 75 2e 70 6f |target.n|ame.u.po|
|00000b40| 72 74 54 79 70 65 53 74 | 72 29 20 2b 20 31 3b 20 |rtTypeSt|r) + 1; |
|00000b50| 2f 2a 6b 6c 6f 6f 6f 67 | 65 2a 2f 0d 09 09 7d 0d |/*klooog|e*/...}.|
|00000b60| 09 09 0d 09 28 2a 72 65 | 73 75 6c 74 29 2e 64 65 |....(*re|sult).de|
|00000b70| 73 63 72 69 70 74 6f 72 | 54 79 70 65 20 3d 20 74 |scriptor|Type = t|
|00000b80| 79 70 65 54 79 70 65 3b | 0d 09 0d 09 72 65 74 75 |ypeType;|....retu|
|00000b90| 72 6e 20 28 50 74 72 54 | 6f 48 61 6e 64 20 28 61 |rn (PtrT|oHand (a|
|00000ba0| 64 64 72 65 73 73 6f 66 | 74 79 70 65 2c 20 26 28 |ddressof|type, &(|
|00000bb0| 2a 72 65 73 75 6c 74 29 | 2e 64 61 74 61 48 61 6e |*result)|.dataHan|
|00000bc0| 64 6c 65 2c 20 34 29 29 | 3b 0d 09 7d 20 2f 2a 43 |dle, 4))|;..} /*C|
|00000bd0| 6f 65 72 63 65 54 61 72 | 67 65 74 49 44 54 6f 54 |oerceTar|getIDToT|
|00000be0| 79 70 65 2a 2f 0d 09 0d | 09 0d 73 74 61 74 69 63 |ype*/...|..static|
|00000bf0| 20 70 61 73 63 61 6c 20 | 4f 53 45 72 72 20 43 6f | pascal |OSErr Co|
|00000c00| 65 72 63 65 50 53 4e 54 | 6f 54 79 70 65 20 28 44 |ercePSNT|oType (D|
|00000c10| 65 73 63 54 79 70 65 20 | 74 79 70 65 63 6f 64 65 |escType |typecode|
|00000c20| 2c 20 50 74 72 20 64 61 | 74 61 70 74 72 2c 20 53 |, Ptr da|taptr, S|
|00000c30| 69 7a 65 20 64 61 74 61 | 73 69 7a 65 2c 20 44 65 |ize data|size, De|
|00000c40| 73 63 54 79 70 65 20 74 | 6f 74 79 70 65 2c 20 6c |scType t|otype, l|
|00000c50| 6f 6e 67 20 72 65 66 63 | 6f 6e 2c 20 41 45 44 65 |ong refc|on, AEDe|
|00000c60| 73 63 20 2a 72 65 73 75 | 6c 74 29 20 7b 0d 09 0d |sc *resu|lt) {...|
|00000c70| 09 50 72 6f 63 65 73 73 | 49 6e 66 6f 52 65 63 20 |.Process|InfoRec |
|00000c80| 69 6e 66 6f 3b 0d 09 4f | 53 45 72 72 20 65 63 3b |info;..O|SErr ec;|
|00000c90| 0d 09 0d 09 69 6e 66 6f | 2e 70 72 6f 63 65 73 73 |....info|.process|
|00000ca0| 49 6e 66 6f 4c 65 6e 67 | 74 68 20 3d 20 28 6c 6f |InfoLeng|th = (lo|
|00000cb0| 6e 67 29 20 73 69 7a 65 | 6f 66 20 28 69 6e 66 6f |ng) size|of (info|
|00000cc0| 29 3b 0d 09 0d 09 69 6e | 66 6f 2e 70 72 6f 63 65 |);....in|fo.proce|
|00000cd0| 73 73 4e 61 6d 65 20 3d | 20 6e 69 6c 3b 0d 09 0d |ssName =| nil;...|
|00000ce0| 09 69 6e 66 6f 2e 70 72 | 6f 63 65 73 73 41 70 70 |.info.pr|ocessApp|
|00000cf0| 53 70 65 63 20 3d 20 6e | 69 6c 3b 0d 09 0d 09 65 |Spec = n|il;....e|
|00000d00| 63 20 3d 20 47 65 74 50 | 72 6f 63 65 73 73 49 6e |c = GetP|rocessIn|
|00000d10| 66 6f 72 6d 61 74 69 6f | 6e 20 28 28 50 72 6f 63 |formatio|n ((Proc|
|00000d20| 65 73 73 53 65 72 69 61 | 6c 4e 75 6d 62 65 72 20 |essSeria|lNumber |
|00000d30| 2a 29 20 64 61 74 61 70 | 74 72 2c 20 26 69 6e 66 |*) datap|tr, &inf|
|00000d40| 6f 29 3b 0d 09 0d 09 69 | 66 20 28 65 63 20 21 3d |o);....i|f (ec !=|
|00000d50| 20 6e 6f 45 72 72 29 0d | 09 09 72 65 74 75 72 6e | noErr).|..return|
|00000d60| 20 28 65 63 29 3b 0d 09 | 09 0d 09 28 2a 72 65 73 | (ec);..|...(*res|
|00000d70| 75 6c 74 29 2e 64 65 73 | 63 72 69 70 74 6f 72 54 |ult).des|criptorT|
|00000d80| 79 70 65 20 3d 20 74 79 | 70 65 54 79 70 65 3b 0d |ype = ty|peType;.|
|00000d90| 09 0d 09 72 65 74 75 72 | 6e 20 28 50 74 72 54 6f |...retur|n (PtrTo|
|00000da0| 48 61 6e 64 20 28 26 69 | 6e 66 6f 2e 70 72 6f 63 |Hand (&i|nfo.proc|
|00000db0| 65 73 73 53 69 67 6e 61 | 74 75 72 65 2c 20 26 28 |essSigna|ture, &(|
|00000dc0| 2a 72 65 73 75 6c 74 29 | 2e 64 61 74 61 48 61 6e |*result)|.dataHan|
|00000dd0| 64 6c 65 2c 20 34 29 29 | 3b 0d 09 7d 20 2f 2a 43 |dle, 4))|;..} /*C|
|00000de0| 6f 65 72 63 65 50 53 4e | 54 6f 54 79 70 65 2a 2f |oercePSN|ToType*/|
|00000df0| 0d 0d 0d 42 6f 6f 6c 65 | 61 6e 20 49 41 43 69 6e |...Boole|an IACin|
|00000e00| 69 74 20 28 76 6f 69 64 | 29 20 7b 0d 09 0d 09 2f |it (void|) {..../|
|00000e10| 2a 0d 09 72 65 74 75 72 | 6e 73 20 74 72 75 65 20 |*..retur|ns true |
|00000e20| 69 66 20 74 68 65 20 6d | 61 63 68 69 6e 65 20 77 |if the m|achine w|
|00000e30| 65 27 72 65 20 72 75 6e | 6e 69 6e 67 20 6f 6e 20 |e're run|ning on |
|00000e40| 68 61 73 20 41 70 70 6c | 65 20 65 76 65 6e 74 73 |has Appl|e events|
|00000e50| 2c 20 61 6e 64 20 69 66 | 20 77 65 20 61 72 65 0d |, and if| we are.|
|00000e60| 09 61 62 6c 65 20 74 6f | 20 69 6e 73 74 61 6c 6c |.able to| install|
|00000e70| 20 6f 75 72 20 63 6f 65 | 72 63 69 6f 6e 20 68 61 | our coe|rcion ha|
|00000e80| 6e 64 6c 65 72 73 2e 20 | 69 74 20 6d 61 79 20 64 |ndlers. |it may d|
|00000e90| 6f 20 6d 6f 72 65 20 69 | 6e 20 66 75 74 75 72 65 |o more i|n future|
|00000ea0| 20 76 65 72 73 69 6f 6e | 73 2e 0d 09 0d 09 63 61 | version|s.....ca|
|00000eb0| 6c 6c 20 74 68 69 73 20 | 72 6f 75 74 69 6e 65 20 |ll this |routine |
|00000ec0| 62 65 66 6f 72 65 20 75 | 73 69 6e 67 20 61 6e 79 |before u|sing any|
|00000ed0| 20 6f 66 20 74 68 65 20 | 6f 74 68 65 72 20 69 61 | of the |other ia|
|00000ee0| 63 2e 63 20 72 6f 75 74 | 69 6e 65 73 2e 20 64 69 |c.c rout|ines. di|
|00000ef0| 73 61 62 6c 65 20 79 6f | 75 72 0d 09 41 70 70 6c |sable yo|ur..Appl|
|00000f00| 65 20 65 76 65 6e 74 20 | 73 75 70 70 6f 72 74 20 |e event |support |
|00000f10| 69 66 20 77 65 20 72 65 | 74 75 72 6e 20 66 61 6c |if we re|turn fal|
|00000f20| 73 65 2e 0d 09 0d 09 38 | 2f 32 33 2f 39 32 20 44 |se.....8|/23/92 D|
|00000f30| 57 3a 20 6f 6e 6c 79 20 | 69 6e 69 74 69 61 6c 69 |W: only |initiali|
|00000f40| 7a 65 20 6f 6e 63 65 2c | 20 6e 6f 20 6d 61 74 74 |ze once,| no matt|
|00000f50| 65 72 20 68 6f 77 20 6d | 61 6e 79 20 74 69 6d 65 |er how m|any time|
|00000f60| 73 20 77 65 27 72 65 20 | 63 61 6c 6c 65 64 2e 0d |s we're |called..|
|00000f70| 09 2a 2f 0d 09 0d 09 73 | 74 61 74 69 63 20 42 6f |.*/....s|tatic Bo|
|00000f80| 6f 6c 65 61 6e 20 66 6c | 20 3d 20 66 61 6c 73 65 |olean fl| = false|
|00000f90| 3b 20 0d 09 0d 09 69 66 | 20 28 66 6c 29 20 0d 09 |; ....if| (fl) ..|
|00000fa0| 09 72 65 74 75 72 6e 20 | 28 74 72 75 65 29 3b 0d |.return |(true);.|
|00000fb0| 09 09 0d 09 66 6c 20 3d | 20 74 72 75 65 3b 0d 09 |....fl =| true;..|
|00000fc0| 0d 09 69 66 20 28 21 49 | 41 43 68 61 76 65 61 70 |..if (!I|AChaveap|
|00000fd0| 70 6c 65 65 76 65 6e 74 | 73 20 28 29 29 0d 09 09 |pleevent|s ())...|
|00000fe0| 72 65 74 75 72 6e 20 28 | 66 61 6c 73 65 29 3b 0d |return (|false);.|
|00000ff0| 09 09 0d 09 69 66 20 28 | 21 49 41 43 69 6e 73 74 |....if (|!IACinst|
|00001000| 61 6c 6c 63 6f 65 72 63 | 69 6f 6e 68 61 6e 64 6c |allcoerc|ionhandl|
|00001010| 65 72 20 28 74 79 70 65 | 50 72 6f 63 65 73 73 53 |er (type|ProcessS|
|00001020| 65 72 69 61 6c 4e 75 6d | 62 65 72 2c 20 74 79 70 |erialNum|ber, typ|
|00001030| 65 54 79 70 65 2c 20 28 | 50 72 6f 63 50 74 72 29 |eType, (|ProcPtr)|
|00001040| 20 26 43 6f 65 72 63 65 | 50 53 4e 54 6f 54 79 70 | &Coerce|PSNToTyp|
|00001050| 65 29 29 0d 09 09 72 65 | 74 75 72 6e 20 28 66 61 |e))...re|turn (fa|
|00001060| 6c 73 65 29 3b 0d 09 09 | 0d 09 69 66 20 28 21 49 |lse);...|..if (!I|
|00001070| 41 43 69 6e 73 74 61 6c | 6c 63 6f 65 72 63 69 6f |ACinstal|lcoercio|
|00001080| 6e 68 61 6e 64 6c 65 72 | 20 28 74 79 70 65 54 61 |nhandler| (typeTa|
|00001090| 72 67 65 74 49 44 2c 20 | 74 79 70 65 54 79 70 65 |rgetID, |typeType|
|000010a0| 2c 20 28 50 72 6f 63 50 | 74 72 29 20 26 43 6f 65 |, (ProcP|tr) &Coe|
|000010b0| 72 63 65 54 61 72 67 65 | 74 49 44 54 6f 54 79 70 |rceTarge|tIDToTyp|
|000010c0| 65 29 29 0d 09 09 72 65 | 74 75 72 6e 20 28 66 61 |e))...re|turn (fa|
|000010d0| 6c 73 65 29 3b 0d 09 09 | 0d 09 49 41 43 67 6c 6f |lse);...|..IACglo|
|000010e0| 62 61 6c 73 2e 69 64 70 | 72 6f 63 65 73 73 20 3d |bals.idp|rocess =|
|000010f0| 20 49 41 43 67 65 74 70 | 72 6f 63 65 73 73 63 72 | IACgetp|rocesscr|
|00001100| 65 61 74 6f 72 20 28 29 | 3b 0d 0d 09 49 41 43 67 |eator ()|;...IACg|
|00001110| 6c 6f 62 61 6c 73 2e 77 | 61 69 74 72 6f 75 74 69 |lobals.w|aitrouti|
|00001120| 6e 65 20 3d 20 6e 69 6c | 3b 0d 09 0d 09 49 41 43 |ne = nil|;....IAC|
|00001130| 67 6c 6f 62 61 6c 73 2e | 6e 65 78 74 70 61 72 61 |globals.|nextpara|
|00001140| 6d 6f 70 74 69 6f 6e 61 | 6c 20 3d 20 66 61 6c 73 |moptiona|l = fals|
|00001150| 65 3b 0d 09 09 0d 09 72 | 65 74 75 72 6e 20 28 74 |e;.....r|eturn (t|
|00001160| 72 75 65 29 3b 0d 09 7d | 20 2f 2a 49 41 43 69 6e |rue);..}| /*IACin|
|00001170| 69 74 2a 2f 0d 09 0d 09 | 0d 42 6f 6f 6c 65 61 6e |it*/....|.Boolean|
|00001180| 20 49 41 43 68 61 76 65 | 61 70 70 6c 65 65 76 65 | IAChave|appleeve|
|00001190| 6e 74 73 20 28 76 6f 69 | 64 29 20 7b 0d 0d 09 2f |nts (voi|d) {.../|
|000011a0| 2a 0d 09 72 65 74 75 72 | 6e 20 74 72 75 65 20 69 |*..retur|n true i|
|000011b0| 66 20 41 70 70 6c 65 20 | 45 76 65 6e 74 73 20 61 |f Apple |Events a|
|000011c0| 72 65 20 61 76 61 69 6c | 61 62 6c 65 2e 0d 09 2a |re avail|able...*|
|000011d0| 2f 0d 09 0d 09 6c 6f 6e | 67 20 67 65 73 74 61 6c |/....lon|g gestal|
|000011e0| 74 41 70 70 6c 65 45 76 | 65 6e 74 73 50 72 65 73 |tAppleEv|entsPres|
|000011f0| 65 6e 74 3b 0d 09 0d 09 | 69 66 20 28 47 65 73 74 |ent;....|if (Gest|
|00001200| 61 6c 74 20 28 67 65 73 | 74 61 6c 74 41 70 70 6c |alt (ges|taltAppl|
|00001210| 65 45 76 65 6e 74 73 41 | 74 74 72 2c 20 26 67 65 |eEventsA|ttr, &ge|
|00001220| 73 74 61 6c 74 41 70 70 | 6c 65 45 76 65 6e 74 73 |staltApp|leEvents|
|00001230| 50 72 65 73 65 6e 74 29 | 20 21 3d 20 6e 6f 45 72 |Present)| != noEr|
|00001240| 72 29 0d 09 09 72 65 74 | 75 72 6e 20 28 66 61 6c |r)...ret|urn (fal|
|00001250| 73 65 29 3b 0d 09 0d 09 | 72 65 74 75 72 6e 20 28 |se);....|return (|
|00001260| 67 65 73 74 61 6c 74 41 | 70 70 6c 65 45 76 65 6e |gestaltA|ppleEven|
|00001270| 74 73 50 72 65 73 65 6e | 74 20 21 3d 20 30 29 3b |tsPresen|t != 0);|
|00001280| 0d 09 7d 20 2f 2a 49 41 | 43 68 61 76 65 61 70 70 |..} /*IA|Chaveapp|
|00001290| 6c 65 65 76 65 6e 74 73 | 2a 2f 0d 0d 0d 09 0d 09 |leevents|*/......|
|000012a0| 0d 0d 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001300| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 46 |.......L|...L...F|
|00001310| 6f 64 f1 31 60 90 5a 4f | 50 14 01 0a 4f ef 00 10 |od.1`.ZO|P...O...|
|00001320| 60 00 01 03 22 99 02 6f | 70 6e 6f 18 2f 2e 00 0c |`..."..o|pno./...|
|00001330| 09 69 61 63 61 70 70 73 | 2e 63 02 00 00 00 50 61 |.iacapps|.c....Pa|
|00001340| 72 74 53 49 54 78 00 00 | 00 00 00 00 00 00 00 01 |rtSITx..|........|
|00001350| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00001360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001370| 00 00 a9 81 44 d2 00 00 | 00 00 00 00 01 92 02 69 |....D...|.......i|
|00001380| 6e 66 6f 20 04 01 02 8a | 99 02 73 63 6c 72 20 04 |nfo ....|..sclr .|
|00001390| 01 02 72 99 02 61 6c 69 | 73 20 04 01 02 5a da 5b |..r..ali|s ...Z.[|
|000013a0| 25 59 5b 20 00 12 00 a8 | 4e 91 67 7f 01 08 28 a3 |%Y[ ....|N.g...(.|
|000013b0| bf 02 56 c6 44 06 50 01 | 09 2a 9d a6 7f 28 bf 01 |..V.D.P.|.*...(..|
|000013c0| 42 47 57 2d 50 3a 12 4a | 80 58 8f ec 31 32 01 13 |BGW-P:.J|.X..12..|
|000013d0| 5a 6d d3 50 01 02 22 ef | 57 2d 50 3c 55 01 10 06 |Zm.P..".|W-P<U...|
|000013e0| 13 4a 80 20 54 02 28 01 | 00 7f bf 02 ef 08 81 28 |.J. T.(.|.......(|
|000013f0| bf a0 90 50 01 01 da 6d | 6b 01 01 d8 2f 01 0c a8 |...P...m|k.../...|
|00001400| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00001410| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001420| 00 00 00 00 00 00 00 06 | 00 04 00 38 00 14 01 d6 |........|...8....|
|00001430| 02 40 00 38 00 14 01 d6 | 02 40 a8 20 76 ff 00 00 |.@.8....|.@. v...|
|00001440| 10 f9 00 00 10 f9 00 00 | 0f 70 01 00 00 00 01 00 |........|.p......|
|00001450| 00 00 01 4c 00 00 00 4c | 00 00 00 46 00 eb 4e cc |...L...L|...F..N.|
|00001460| 17 e0 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|00001470| 00 0a 03 ed 00 00 00 00 | 00 00 00 eb 4d dc 13 43 |........|....M..C|
|00001480| 72 65 61 74 65 64 20 62 | 79 20 43 4d 61 73 74 65 |reated b|y CMaste|
|00001490| 72 aa 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |r.......|........|
|000014a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+